<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性布局</title>
    <style>
        .box{
         background-color: red;   
         height: 100px;
         width: 50%;
         margin-bottom: 10px;
         display: flex;
        }
        .box:nth-last-child(2){
            background-color: blue;
        }
        .item{
            flex:1;
            font-size: 20px;
            color: black;
            display: inline-block;
            background-color: green;
        }
        .item:nth-child(2){
            background-color: yellow;
        }
         *{
            margin: 0;
            padding: 0;
         }
    </style>
</head>
<body>
    <div class="box">
       <div class="item">1</div>
       <div class="item">2</div>
       <div class="item">3</div>
    </div><div class="box"></div>
</body>
</html>